//
//  UIBarButtonItem+HHExtension.m
//  百思不得姐
//
//  Created by LOVE on 16/3/9.
//  Copyright © 2016年 LOVE. All rights reserved.
//

#import "UIBarButtonItem+HHExtension.h"

@implementation UIBarButtonItem (HHExtension)
+(instancetype)itemWithImage:(NSString *)image highImage:(NSString *)highImage target:(id)target action:(SEL)action{

    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    
    [btn setBackgroundImage:[UIImage imageNamed:image] forState:UIControlStateNormal];
    [btn setBackgroundImage:[UIImage imageNamed:highImage] forState:UIControlStateHighlighted];
    
    btn.size = btn.currentBackgroundImage.size;
    
    [btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    
    return [[self alloc]initWithCustomView:btn];


}
@end
